---
title   : Home
layout  : moment-base.hbs
order   : 0
scripts :
  - core-home
---

<header class="hero hero-moment">
	<div class="centered">
		<div class="hero-circle">
			<div class="hero-face">
				<div id="hour" class="hero-hour"></div>
				<div id="minute" class="hero-minute"></div>
				<div id="second" class="hero-second"></div>
			</div>
		</div>
		<div class="hero-title">
			<h1>Moment.js <span>{{ size.moment_version }}</span></h1>
			<h2>Parse, validate, manipulate, and display dates and times in JavaScript.</h2>
		</div>
	</div>
</header>


<div class="builds">
	<div class="builds-download">
		<h3>Download</h3>
		<a class="builds-button builds-button-source" href="/downloads/moment.js">
			moment.js
		</a>
		<a class="builds-button builds-button-gzipped" href="/downloads/moment.min.js">
			moment.min.js
			<span class="filesize">{{toKb size.moment_min.gzip }}</span>
		</a>
		<a class="builds-button builds-button-source" href="/downloads/moment-with-locales.js">
			moment-with-locales.js
		</a>
		<a class="builds-button builds-button-gzipped" href="/downloads/moment-with-locales.min.js">
			moment-with-locales.min.js
			<span class="filesize">{{toKb size.moment_with_locales_min.gzip }}</span>
		</a>
	</div>
	<div class="builds-packages">
		<h3>Install</h3>
		<pre><code>npm install moment --save   <span class="comment"># npm</span>
yarn add moment             <span class="comment"># Yarn</span>
Install-Package Moment.js   <span class="comment"># NuGet</span>
spm install moment --save   <span class="comment"># spm</span>
meteor add momentjs:moment  <span class="comment"># meteor</span>
bower install moment --save <span class="comment"># bower (deprecated)</span>
</code></pre>
	</div>
</div>

<div class="page-moment-index">

{{#markdown}}
### Format Dates

```js
moment().format('MMMM Do YYYY, h:mm:ss a');
moment().format('dddd');
moment().format("MMM Do YY");
moment().format('YYYY [escaped] YYYY');
moment().format();
```

### Relative Time

```js
moment("20111031", "YYYYMMDD").fromNow();
moment("20120620", "YYYYMMDD").fromNow();
moment().startOf('day').fromNow();
moment().endOf('day').fromNow();
moment().startOf('hour').fromNow();
```

### Calendar Time

```js
moment().subtract(10, 'days').calendar();
moment().subtract(6, 'days').calendar();
moment().subtract(3, 'days').calendar();
moment().subtract(1, 'days').calendar();
moment().calendar();
moment().add(1, 'days').calendar();
moment().add(3, 'days').calendar();
moment().add(10, 'days').calendar();
```

### Multiple Locale Support

```js
moment.locale();
moment().format('LT');
moment().format('LTS');
moment().format('L');
moment().format('l');
moment().format('LL');
moment().format('ll');
moment().format('LLL');
moment().format('lll');
moment().format('LLLL');
moment().format('llll');
```

{{/markdown}}

<div class="locales">
	{{#each locale }}
		<div class="button {{#is abbr "en" }}active{{/is}}" data-locale="{{ abbr }}">
			{{ name }}
		</div>
	{{/each}}
</div>

</div>
